Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconnect fix #413

Draft
wants to merge 37 commits into
base: main
Choose a base branch
from
Draft

Reconnect fix #413

wants to merge 37 commits into from

Conversation

TheGrayAlien
Copy link
Collaborator

Over the past weeks with this fix implemented I've been disconnected quite a number of times as host. Each time after the players leave the room and I become host again the rulesets have returned to full functionality. Last night during two consecutive games using a ruleset using 33 rules I was disconnected 3 times and regained host without issue every time. I'll put this up as a draft until others can verify/review the code.

Tested (once so far) and it worked. Keeping as draft until further test runs.
wrong gamestate name in method
Totally forgot to load Post with the Pre.
This should prevent a second HR using player from activating their ruleset if they gain host.
Notify Host with a shorter timed welcome message when ruleset is restored.
Level sequence already loads properly without redefining it. Freezes game otherwise.
Prevents error message when loading ruleset after reconnect.
Fix level sequence not loading on new games since last update.
Piece adjustments get lost if unloaded so keep them activated for possible reconnect.
Don't reload them if reconnect as they are already still loaded.
If it's not your game and you become host it will deactivate ALL rules.
Set gameId when hitting play again in case of disconnect in next match
Some rules were prevented from loading when new room initialized after a disconnect.
Prevent manual disconnects from being seen as forced disconnects.
Only try to reconnect mod on unintentional disconnects
User CoreMod logger for consistency
Fully deactivate ruleset if joining a different game
Only report disconnects and set _isReconnect if you are hosting and ruleset is active
IDisableOnReconnect Type prevents unload/load of rule on disconnect
Added Type to (so far) discovered problematic rules
Skipping (might) not (be) necessary? Will test.
Try skip deactivation and reactivation of non-working rules. Untested.
PieceConfig wasn't working so added to IDisableOnReconnect list
Use original game creation room code as reference instead.
Let ruleset load when active if reconnect possible
Don't try to reconnect if quitting when game is ended
Variable prevented reconnect after finished game and was unnecessary.
This rule also doesn't work when new players enter if not held in memory after reconnect.
Deactivates only reconnection rules as needed.
Only deactivate active reconnection rules when manually disconnecting.
@jimconner
Copy link
Collaborator

Amazing work @TheGrayAlien - All of this looks good to me.

TheGrayAlien and others added 2 commits July 29, 2022 16:15
Changes some log warnings to messages and vice versa
Consolidate some code
@TheGrayAlien
Copy link
Collaborator Author

Looked it over and cleaned up some logs and added code speedups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants